package com.sbtr.business.classify.entity;

import io.swagger.annotations.ApiModelProperty;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;

import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;

import lombok.Data;
import lombok.EqualsAndHashCode;
    import lombok.experimental.Accessors;
import io.swagger.annotations.ApiModel;


/**
 * 轻量化算法参数版本(高质量芯片项目) 实体类
 *
 * @author maojianping
 * @since 2023-04-17
 */
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@TableName("a_algo_param_version")
@ApiModel(value="AlgoParamVersion对象")
public class AlgoParamVersion extends Model<AlgoParamVersion> {

    @ApiModelProperty(value = "ID")
    @TableId(value = "id")
    private Long id;

    @ApiModelProperty(value = "算法参数版本名称")
    private String vname;

    @ApiModelProperty(value = "版本号")
    private String version;

    @ApiModelProperty(value = "版本概要介绍")
    private String overview;

    @ApiModelProperty(value = "默认版本（1代表默认）")
    private Integer defversion;

    @ApiModelProperty(value = "下载累计次数")
    private Integer counts;

    @ApiModelProperty(value = "创建人")
    private String editor;

    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")// 后台传数据到前台
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") //前台传数据到后台
    private Date updateTime;

    @ApiModelProperty(value = "备注")
    private String remarks;

    @ApiModelProperty(value = "算法模板表algorithm_template的ID")
    private Long templateId;

    public AlgoParamVersion(String editor, Long templateId) {
        this.version = "V1.0"; // 默认初始版本
        this.counts = 0; // 初始化下载次数
        this.updateTime = new Date();
        this.defversion = 1; // 设置为默认版本，除了系统管理员，其他人不可以修改
        this.vname = "算法模板原始版本";
        this.editor = editor;
        this.templateId = templateId;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }
}
